package com.tarena.lbs.basic.web.controller;



import com.tarena.lbs.base.protocol.exception.BusinessException;
import com.tarena.lbs.basic.web.service.LoginService;
import com.tarena.lbs.pojo.passport.param.AdminLoginParam;
import com.tarena.lbs.pojo.passport.vo.LoginVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.tarena.lbs.base.protocol.model.Result;


@Slf4j
@RestController
public class LoginController {


    @Autowired
    private LoginService loingService;


    @PostMapping("/passport/admin/login")
    public Result<LoginVO> adminLogin(@RequestBody AdminLoginParam adminLoginParam) throws BusinessException {
        log.debug("adminLogin:{}",adminLoginParam);
        log.debug("当前线程是={}",Thread.currentThread().getName());
        LoginVO loginVO = loingService.login(adminLoginParam);

        return new Result<>(loginVO);
    }



}
